//
//  UITableView+Refresh.m
//  lvfj
//
//  Created by lvfeijun on 2021/6/3.
//  Copyright © 2021 Goudu KuaiEx Technology(Shenzhen)Co.,ltd. All rights reserved.
//

#import "UITableView+Refresh.h"

//MJRefresh

@implementation UITableView (Refresh)
-(void)setRefreshData{
    __weak typeof(self) wSelf = self;
    self.tableView.mj_header = [LFRefreshHeader headerWithRefreshingBlock:^{
        __strong typeof(wSelf) sSelf = wSelf;
        [sSelf requestData:NO];
    }];
}
-(void)setLoadMoreData{
    self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
        @strongify(self)
        [self loadMoreData];
    }];
}
-(void)endRefresh:(UIScrollView *)tableView{
    if (tableView.mj_header) {
        [tableView.mj_header endRefreshing];
    }
    if (tableView.mj_footer) {
        [tableView.mj_footer endRefreshing];
    }
}


@end
